package com.example.demo.controller;


import com.example.demo.vo.HeapOOM;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jierui
 * @package com.example.demo
 * @date 2021/2/18-11:14
 * @description: 堆栈溢出测试
 *
 * VM Args:
 *
 * -Xms500m -Xmx500m -XX:+HeapDumpOnOutOfMemoryError  -XX:HeapDumpPath=C:\Users\pc-3356\Desktop\sql
 */
@RestController
public class JvmController {



    @GetMapping("test/jvm")
    public void jvmTest() {
        List<HeapOOM> list = new ArrayList<>();

        int index=0;
        while (true) {
            list.add(new HeapOOM("n:"+index,"v:"+index));
            index++;
        }

    }

    @GetMapping("test/alive")
    public String alive() {
        return "没死活着呢";

    }

}
